package com.yanqu.road.entity.union;

import com.yanqu.road.entity.DataObject;

import java.util.ArrayList;
import java.util.List;

public class UserUnionChamberData extends DataObject {
    private long userId;
    private long lastResetTime;
    private List<Long> useHuntUserIdList = new ArrayList<>();

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getLastResetTime() {
        return lastResetTime;
    }

    public void setLastResetTime(long lastResetTime) {
        if(this.lastResetTime != lastResetTime) {
            this.lastResetTime = lastResetTime;
            setUpdateOption();
        }
    }

    public List<Long> getUseHuntUserIdList() {
        return useHuntUserIdList;
    }

    public void setUseHuntUserIdList(List<Long> useHuntUserIdList) {
        this.useHuntUserIdList = useHuntUserIdList;
        setUpdateOption();
    }

    public boolean hasUseHunt(long userId){
        return useHuntUserIdList.contains(userId);
    }

    public void addUseHunt(long userId){
        if(!hasUseHunt(userId)){
            useHuntUserIdList.add(userId);
            setUpdateOption();
        }
    }

    public int getUseHuntCount(){
        return useHuntUserIdList.size();
    }
}
